package tedu.cn.submarine;

import javax.swing.ImageIcon;

public class Battleship extends SeaObject {
    private int life;
    public Battleship(){
        super(108,40,458,70,20);
        life = 5;
    }

    public ImageIcon getImage(){
        return Images.battleship;
    }

    public Bomb shootBomb(){
        return new Bomb(this.getX(),this.getY());
    }

    public void move(){
        System.out.println();
    }

    public void moveLeft(){
        setX(getX()-getSpeed());
    }

    public void moveRight(){
        setX(getX()+getSpeed());
    }

    public void addLife(int num){
        life += num;
    }

    public int getLife(){
        return life;
    }

    public void subtractLife(){
        life--;
    }

    public Shield getShield(int x,int y){
        return new Shield(x+this.getWidth()/2,y-this.getHeight()/2);
    }

}
